package bb.lanxing.calc.data;

import android.location.Location;
import android.os.Parcel;
import android.os.Parcelable;
import com.github.mikephil.charting.utils.Utils;

import bb.lanxing.model.database.Workout;

public class DisplayPoint implements Parcelable {
    final static private String TAG = "DisplayPoint";

    public static final int SPORT_STATE_NONE = 0;

    public static final Parcelable.Creator<DisplayPoint> CREATOR = new Parcelable.Creator<>() {
        @Override
        public DisplayPoint createFromParcel(Parcel parcel) {
            return new DisplayPoint(parcel);
        }

        @Override
        public DisplayPoint[] newArray(int i) {
            return new DisplayPoint[i];
        }
    };
    private float accuracy;
    private Double altitude;
    private Float avg10sPower;
    private Float avg30sPower;
    private Float avg3sPower;
    private Integer avgCadence;
    private Float avgElevationGain;
    private Float avgElevationLoss;
    private Integer avgHeartrate;
    private Float avgPower;
    private Double avgSpeed;
    private Integer azimuth;
    private Integer cadence;
    private Integer calorie;
    private Float direction;
    private Double distance;
    private Long duration;
    private Float elevationGain;
    private Float elevationLoss;
    private Float grade;
    private Integer heartrate;
    private Float heartrateLTHT;
    private Location location;
    private Double maxAltitude;
    private Integer maxCadence;
    private Float maxElevationGain;
    private Float maxElevationLoss;
    private Integer maxHeartrate;
    private Float maxHeartratePer;
    private Float maxPower;
    private Double maxSpeed;
    private Float maxTemperature;
    private Double minAltitude;
    private Float minTemperature;
    private Long pauseDuration;
    private Float power;
    private Float indoorbikepower;
    private Integer indoorbikeresistancelevel;
    private Integer indoorbikeheartrate;
    private Integer indoorbikeenergy;
    private Double indoorbiketotaldistance;
    private Float crosstrainerpower;
    private Integer crosstrainerresistancelevel;
    private Integer crosstrainerenergy;
    private Double crosstrainertotaldistance;
    private Integer crosstrainerstride;
    private Integer crosstrainersteprate;
    private Integer rowerpower;
    private Integer roweravgpower;
    private Integer rowerresistancelevel;
    private Integer roweravgstrokerate;
    private Integer rowerstrokerate;
    private Integer rowerstrokecount;
    private Integer rowerenergy;
    private Double rowertotaldistance;
    private Double rowerpace;
    private Double roweravgpace;
    private Float powerFTPPer;
    private Float powerNP;
    private Float powerTSS;
    private float pressure;
    private Double speed;
    private int sportState;
    private int sportType;
    private Integer steps;
    private Float temperature;
    private Double totalAvgSpeed;
    private Long totalDuration;
    private long workoutId;

    @Override
    public int describeContents() {
        return 0;
    }

    public DisplayPoint() {
    }

    public DisplayPoint(Workout lastWorkout) {
        if (lastWorkout != null) {
            this.speed = (double) Utils.DOUBLE_EPSILON;
            this.distance = lastWorkout.getDistance();
            this.duration = lastWorkout.getDuration();
            this.avgSpeed = lastWorkout.getAvgSpeed();
            this.maxSpeed = lastWorkout.getMaxSpeed();
            this.elevationGain = lastWorkout.getElevationGain();
            this.grade = lastWorkout.getGrade();
            this.calorie = lastWorkout.getCalorie();
            this.avgCadence = lastWorkout.getAvgCadence();
            this.maxCadence = lastWorkout.getMaxCadence();
            this.avgHeartrate = lastWorkout.getAvgHeartrate();
            this.maxHeartrate = lastWorkout.getMaxHeartrate();
            if (lastWorkout.getId() != null) {
                this.workoutId = lastWorkout.getId();
            }
            this.sportState = lastWorkout.getWorkStatus();
            this.sportType = lastWorkout.getSport();
            return;
        }
        this.sportState = SPORT_STATE_NONE;//0
        this.sportType = Workout.TYPE_CYCLING;//3
    }

    public void reset() {
        this.workoutId = 0L;
        this.sportState = SPORT_STATE_NONE;//0
        this.sportType = Workout.TYPE_OTHER;//0
        this.accuracy = 0.0f;
        this.pressure = 0.0f;
        this.location = null;
        this.distance = null;
        this.speed = null;
        this.avgSpeed = null;
        this.maxSpeed = null;
        this.totalAvgSpeed = null;
        this.duration = null;
        this.totalDuration = null;
        this.pauseDuration = null;
        this.altitude = null;
        this.maxAltitude = null;
        this.minAltitude = null;
        this.grade = null;
        this.elevationGain = null;
        this.elevationLoss = null;
        this.avgElevationGain = null;
        this.avgElevationLoss = null;
        this.maxElevationGain = null;
        this.maxElevationLoss = null;
        this.cadence = null;
        this.avgCadence = null;
        this.maxCadence = null;
        this.heartrate = null;
        this.avgHeartrate = null;
        this.maxHeartrate = null;
        this.maxHeartratePer = null;
        this.heartrateLTHT = null;
        this.power = null;
        this.indoorbikepower = null;
        this.indoorbikeresistancelevel = null;
        this.indoorbikeenergy = null;
        this.indoorbiketotaldistance = null;
        this.indoorbikeheartrate = null;
        this.crosstrainerpower = null;
        this.crosstrainerresistancelevel = null;
        this.crosstrainerenergy = null;
        this.crosstrainertotaldistance = null;
        this.crosstrainerstride = null;
        this.crosstrainersteprate = null;
        this.rowerstrokerate = null;
        this.rowerstrokecount = null;
        this.roweravgstrokerate = null;
        this.rowertotaldistance = null;
        this.rowerpace = null;
        this.roweravgpace = null;
        this.rowerpower = null;
        this.roweravgpower = null;
        this.rowerresistancelevel = null;
        this.rowerenergy = null;
        this.avgPower = null;
        this.maxPower = null;
        this.avg3sPower = null;
        this.avg10sPower = null;
        this.avg30sPower = null;
        this.powerFTPPer = null;
        this.powerNP = null;
        this.powerTSS = null;
        this.temperature = null;
        this.maxTemperature = null;
        this.minTemperature = null;
        this.calorie = null;
        this.steps = null;
        this.direction = null;
        this.azimuth = null;
    }

    public void setupWorkout(Workout workout) {
        if (workout != null) {
            workoutId = workout.getId();
            sportState = workout.getWorkStatus();
            sportType = workout.getSport();
            return;
        }
        sportState = Workout.STATUS_UNSTART;//0
        sportType = Workout.TYPE_CYCLING;//3
    }

    @Deprecated
    public void setData(SourcePoint sourcePoint) {
        if (sourcePoint == null) {
            return;
        }
        speed = sourcePoint.hasWheelData() ? sourcePoint.getCadencePoint().getSpeed() : sourcePoint.getSpeed();
        altitude = (!sourcePoint.hasPressure() || !sourcePoint.hasGps()) ? sourcePoint.getAltitude() : sourcePoint.getGpsPoint().getAltitude();
        power = sourcePoint.getPower();
        indoorbikepower = sourcePoint.getIndoorbikePower();
        //Log.d(TAG, "setData indoorbikepower is " + indoorbikepower);
        steps = sourcePoint.getSteps();
        GpsPoint gpsPoint = sourcePoint.getGpsPoint();
        if (gpsPoint != null) {
            accuracy = gpsPoint.getAccuracy();
            location = sourcePoint.getGpsPoint().getLocation();
        }
        CadencePoint cadencePoint = sourcePoint.getCadencePoint();
        if (cadencePoint != null) {
            cadence = cadencePoint.getCadence();
            temperature = cadencePoint.getRealTemperature();
            pressure = cadencePoint.getRealPressure();
        }
        HeartratePoint heartratePoint = sourcePoint.getHeartratePoint();
        if (heartratePoint != null) {
            heartrate = heartratePoint.getHeartrate();
        }
        PowerratePoint powerratePoint = sourcePoint.getPowerratePoint();
        if (powerratePoint != null) {
            power = (float) powerratePoint.getPowerrate();
        }

        BiketrainerPoint biketrainerPoint = sourcePoint.getBiketrainerPoint();
        if (biketrainerPoint != null) {
            power = (float) biketrainerPoint.getBiketrainerPower();
            cadence = biketrainerPoint.getBiketrainerCadence();
        }

        IndoorbikePoint indoorbikePoint = sourcePoint.getIndoorbikePoint();
        if (indoorbikePoint != null) {
            speed = (double) indoorbikePoint.getIndoorbikeSpeed();
            cadence = indoorbikePoint.getIndoorbikeCadence();
            power = (float) indoorbikePoint.getIndoorbikePower();
            indoorbikeresistancelevel =  indoorbikePoint.getIndoorbikeResistanceLevel();
            indoorbikeenergy =  indoorbikePoint.getIndoorbikeEnergy();
            indoorbiketotaldistance = indoorbikePoint.getIndoorbikeTotalDistance();
        }

        CrosstrainerPoint crosstrainerPoint = sourcePoint.getCrosstrainerPoint();
        if (crosstrainerPoint != null) {
            speed = (double) crosstrainerPoint.getCrosstrainerSpeed();
            crosstrainerstride = crosstrainerPoint.getCrosstrainerStride();
            crosstrainersteprate = crosstrainerPoint.getCrosstrainerStepRate();
            power = (float) crosstrainerPoint.getCrosstrainerPower();
            crosstrainerresistancelevel =  crosstrainerPoint.getCrosstrainerResistanceLevel();
            crosstrainerenergy =  crosstrainerPoint.getCrosstrainerEnergy();
            crosstrainertotaldistance = crosstrainerPoint.getCrosstrainerTotalDistance();
        }

        RowerPoint rowerPoint = sourcePoint.getRowerPoint();
        if (rowerPoint != null) {
            rowerstrokerate =  rowerPoint.getRowerStrokeRate();
            rowerstrokecount =  rowerPoint.getRowerStrokeCount();
            roweravgstrokerate =  rowerPoint.getRowerAvgStrokeRate();
            rowertotaldistance = rowerPoint.getRowerTotalDistance();
            rowerpace = rowerPoint.getRowerPace();
            roweravgpace = rowerPoint.getRowerAvgPace();
            rowerpower = rowerPoint.getRowerPower();
            roweravgpower = rowerPoint.getRowerAvgPower();
            rowerresistancelevel =  rowerPoint.getRowerResistanceLevel();
            rowerenergy =  rowerPoint.getRowerEnergy();
         }
    }

    @Deprecated
    public void setData(SourcePoint sourcePoint, Workout workout) {
        reset();
        setData(sourcePoint);
        if (workout != null) {
            resetSpeedIfNeed(sourcePoint, workout);
            distance = workout.getDistance();
            duration = workout.getDuration();
            avgSpeed = workout.getAvgSpeed();
            maxSpeed = workout.getMaxSpeed();
            elevationGain = workout.getElevationGain();
            grade = workout.getGrade();
            calorie = workout.getCalorie();
            avgCadence = workout.getAvgCadence();
            maxCadence = workout.getMaxCadence();
            avgHeartrate = workout.getAvgHeartrate();
            maxHeartrate = workout.getMaxHeartrate();
            workoutId = workout.getId();
            sportState = workout.getWorkStatus();
            sportType = workout.getSport();
            return;
        }
        sportState = Workout.STATUS_UNSTART;//0
        sportType = Workout.TYPE_CYCLING;//3
    }

    //16, 18, 32
    private void resetSpeedIfNeed(SourcePoint sourcePoint, Workout workout) {
        if ((workout.getWorkStatus() == Workout.STATUS_GPS_SEARCHING && sourcePoint != null && !sourcePoint.hasCadence())
                || workout.getWorkStatus() == Workout.STATUS_PAUSED || workout.getWorkStatus() == Workout.STATUS_STOPED || workout.getWorkStatus() == 0) {
            speed = (double) Utils.DOUBLE_EPSILON;
        }
    }

    public Workout makeWorkout() {
        return Workout.getById(this.workoutId);
    }

    public double getDistance(double d) {
        Double d2 = this.distance;
        return d2 == null ? d : d2;
    }

    public long getDuration(long j) {
        Long l = this.duration;
        return l == null ? j : l;
    }

    public double getSpeed(double d) {
        Double d2 = this.speed;
        return d2 == null ? d : d2;
    }

    public double getAvgSpeed(double d) {
        Double d2 = this.avgSpeed;
        return d2 == null ? d : d2;
    }

    public double getMaxSpeed(double d) {
        Double d2 = this.maxSpeed;
        return d2 == null ? d : d2;
    }

    public double getAltitude(double d) {
        Double d2 = this.altitude;
        return d2 == null ? d : d2;
    }

    public float getGrade(float f) {
        Float f2 = this.grade;
        return f2 == null ? f : f2;
    }

    public float getElevationGain(float f) {
        Float f2 = this.elevationGain;
        return f2 == null ? f : f2;
    }

    public int getCadence(int i) {
        Integer num = this.cadence;
        return num == null ? i : num;
    }

    public int getAvgCadence(int i) {
        Integer num = this.avgCadence;
        return num == null ? i : num;
    }

    public int getMaxCadence(int i) {
        Integer num = this.maxCadence;
        return num == null ? i : num;
    }

    public int getHeartrate(int i) {
        Integer num = this.heartrate;
        return num == null ? i : num;
    }

    public Integer getAvgHeartrate(int i) {
        Integer num = this.avgHeartrate;
        if (num != null) {
            i = num;
        }
        return i;
    }

    public Integer getMaxHeartrate(int i) {
        Integer num = this.maxHeartrate;
        if (num != null) {
            i = num;
        }
        return i;
    }

    public float getPower(float f) {
        Float f2 = this.power;
        return f2 == null ? f : f2;
    }

    public int getIndoorbikeResistanceLevel(int i) {
        Integer num = this.indoorbikeresistancelevel;
        return num == null ? i : num;
    }

    public int getIndoorbikeHeartRate(int i) {
        Integer num = this.indoorbikeheartrate;
        return num == null ? i : num;
    }

    public double getIndoorbikeTotalDistance(double d) {
        Double d2 = this.indoorbiketotaldistance;
        return d2 == null ? d : d2;
    }

    public void setIndoorbikeResistanceLevel(int indoorbikeresistancelevel) {
        this.indoorbikeresistancelevel = indoorbikeresistancelevel;
    }

    public void setIndoorbikeHeartRate(int indoorbikeheartrate) {
        this.indoorbikeheartrate = indoorbikeheartrate;
    }

    public void setIndoorbikeTotalDistance(Double indoorbiketotaldistance) {
        this.indoorbiketotaldistance = indoorbiketotaldistance;
    }

    public void setIndoorbikeEnergy(Integer indoorbikeenergy) {
        this.indoorbikeenergy = indoorbikeenergy;
    }

    public Integer getIndoorbikeEnergy(int i) {
        Integer num = this.indoorbikeenergy;
        return num == null ? i : num;
    }

    public float getIndoorbikePower(float f) {
        Float f2 = this.indoorbikepower;
        return f2 == null ? f : f2;
    }

    public Float getIndoorbikePower() {
        return this.indoorbikepower;
    }

    public void setIndoorbikePower(Float indoorbikepower) {
        this.indoorbikepower = indoorbikepower;
    }

    public int getCrosstrainerResistanceLevel(int i) {
        Integer num = this.crosstrainerresistancelevel;
        return num == null ? i : num;
    }

    public double getCrosstrainerTotalDistance(double d) {
        Double d2 = this.crosstrainertotaldistance;
        return d2 == null ? d : d2;
    }

    public void setCrosstrainerResistanceLevel(int crosstrainerresistancelevel) {
        this.crosstrainerresistancelevel = crosstrainerresistancelevel;
    }

    public void setCrosstrainerTotalDistance(Double crosstrainertotaldistance) {
        this.crosstrainertotaldistance = crosstrainertotaldistance;
    }

    public void setCrosstrainerEnergy(Integer crosstrainerenergy) {
        this.crosstrainerenergy = crosstrainerenergy;
    }

    public Integer getCrosstrainerEnergy(int i) {
        Integer num = this.crosstrainerenergy;
        return num == null ? i : num;
    }

    public void setCrosstrainerStride(Integer crosstrainerstride) {
        this.crosstrainerstride = crosstrainerstride;
    }

    public Integer getCrosstrainerStride(int i) {
        Integer num = this.crosstrainerstride;
        return num == null ? i : num;
    }

    public void setCrosstrainerSteprate(Integer crosstrainersteprate) {
        this.crosstrainersteprate = crosstrainersteprate;
    }

    public Integer getCrosstrainerSteprate(int i) {
        Integer num = this.crosstrainersteprate;
        return num == null ? i : num;
    }
    public float getCrosstrainerPower(float f) {
        Float f2 = this.crosstrainerpower;
        return f2 == null ? f : f2;
    }

    public Float getCrosstrainerPower() {
        return this.crosstrainerpower;
    }

    public void setCrosstrainerPower(Float crosstrainerpower) {
        this.crosstrainerpower = crosstrainerpower;
    }


    public int getRowerStrokeRate(int i) {
        Integer num = this.rowerstrokerate;
        return num == null ? i : num;
    }

    public int getRowerStrokeCount(int i) {
        Integer num = this.rowerstrokecount;
        return num == null ? i : num;
    }

    public int getRowerAvgStrokeRate(int i) {
        Integer num = this.roweravgstrokerate;
        return num == null ? i : num;
    }

    public double getRowerTotalDistance(double d) {
        Double d2 = this.rowertotaldistance;
        return d2 == null ? d : d2;
    }

    public double getRowerPace(double d) {
        Double d2 = this.rowerpace;
        return d2 == null ? d : d2;
    }

    public int getRowerPower(int f) {
        Integer f2 = this.rowerpower;
        return f2 == null ? f : f2;
    }

    public int getRowerResistanceLevel(int i) {
        Integer num = this.rowerresistancelevel;
        return num == null ? i : num;
    }

    public int getRowerEnergy(int i) {
        Integer num = this.rowerenergy;
        return num == null ? i : num;
    }
    public void setRowerStrokeRate(int rowerstrokerate) {
        this.rowerstrokerate = rowerstrokerate;
    }
    public void setRowerStrokeCount(int rowerstrokecount) {
        this.rowerstrokecount = rowerstrokecount;
    }
    public void setRowerAvgStokeRate(int roweravgstrokerate) {
        this.roweravgstrokerate = roweravgstrokerate;
    }

    public void setRowerTotalDistance(Double rowertotaldistance) {
        this.rowertotaldistance = rowertotaldistance;
    }
    public void setRowerPace(Double rowerpace) {
        this.rowerpace = rowerpace;
    }
    public void setRowerAvgPace(Double roweravgpace) {
        this.roweravgpace = roweravgpace;
    }
    public void setRowerPower(int rowerpower) {
        this.rowerpower = rowerpower;
    }
    public void setRowerAvgPower(int roweravgpower) {
        this.roweravgpower = roweravgpower;
    }
    public void setRowerResistanceLevel(int rowerresistancelevel) {
        this.rowerresistancelevel = rowerresistancelevel;
    }
    public void setRowerEnergy(int rowerenergy) {
        this.rowerenergy = rowerenergy;
    }

    public float getTemperature(float f) {
        Float f2 = this.temperature;
        return f2 == null ? f : f2;
    }

    public int getCalorie(int i) {
        Integer num = this.calorie;
        return num == null ? i : num;
    }

    public int getSteps(int i) {
        Integer num = this.steps;
        return num == null ? i : num;
    }

    public long getWorkoutId() {
        return this.workoutId;
    }

    public void setWorkoutId(long workoutId) {
        this.workoutId = workoutId;
    }

    public float getAccuracy() {
        return this.accuracy;
    }

    public void setAccuracy(float accuracy) {
        this.accuracy = accuracy;
    }

    public float getPressure() {
        return this.pressure;
    }

    public void setPressure(float pressure) {
        this.pressure = pressure;
    }

    public int getSportState() {
        return this.sportState;
    }

    public void setSportState(int sportState) {
        this.sportState = sportState;
    }

    public int getSportType() {
        return this.sportType;
    }

    public void setSportType(int sportType) {
        this.sportType = sportType;
    }

    public Location getLocation() {
        return this.location;
    }

    public void setLocation(Location location) {
        this.location = location;
    }

    public Double getDistance() {
        return this.distance;
    }

    public void setDistance(Double distance) {
        this.distance = distance;
    }

    public Double getSpeed() {
        return this.speed;
    }

    public void setSpeed(Double speed) {
        this.speed = speed;
    }

    public Double getAvgSpeed() {
        return this.avgSpeed;
    }

    public void setAvgSpeed(Double avgSpeed) {
        this.avgSpeed = avgSpeed;
    }

    public Double getMaxSpeed() {
        return this.maxSpeed;
    }

    public void setMaxSpeed(Double maxSpeed) {
        this.maxSpeed = maxSpeed;
    }

    public Double getTotalAvgSpeed() {
        return this.totalAvgSpeed;
    }

    public void setTotalAvgSpeed(Double totalAvgSpeed) {
        this.totalAvgSpeed = totalAvgSpeed;
    }

    public Long getDuration() {
        return this.duration;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }

    public Long getTotalDuration() {
        return this.totalDuration;
    }

    public void setTotalDuration(Long totalDuration) {
        this.totalDuration = totalDuration;
    }

    public Long getPauseDuration() {
        return this.pauseDuration;
    }

    public void setPauseDuration(Long pauseDuration) {
        this.pauseDuration = pauseDuration;
    }

    public Double getAltitude() {
        return this.altitude;
    }

    public void setAltitude(Double altitude) {
        this.altitude = altitude;
    }

    public Double getMaxAltitude() {
        return this.maxAltitude;
    }

    public void setMaxAltitude(Double maxAltitude) {
        this.maxAltitude = maxAltitude;
    }

    public Double getMinAltitude() {
        return this.minAltitude;
    }

    public void setMinAltitude(Double minAltitude) {
        this.minAltitude = minAltitude;
    }

    public Float getGrade() {
        return this.grade;
    }

    public void setGrade(Float grade) {
        this.grade = grade;
    }

    public Float getElevationGain() {
        return this.elevationGain;
    }

    public void setElevationGain(Float elevationGain) {
        this.elevationGain = elevationGain;
    }

    public Float getElevationLoss() {
        return this.elevationLoss;
    }

    public void setElevationLoss(Float elevationLoss) {
        this.elevationLoss = elevationLoss;
    }

    public Float getAvgElevationGain() {
        return this.avgElevationGain;
    }

    public void setAvgElevationGain(Float avgElevationGain) {
        this.avgElevationGain = avgElevationGain;
    }

    public Float getAvgElevationLoss() {
        return this.avgElevationLoss;
    }

    public void setAvgElevationLoss(Float avgElevationLoss) {
        this.avgElevationLoss = avgElevationLoss;
    }

    public Float getMaxElevationGain() {
        return this.maxElevationGain;
    }

    public void setMaxElevationGain(Float maxElevationGain) {
        this.maxElevationGain = maxElevationGain;
    }

    public Float getMaxElevationLoss() {
        return this.maxElevationLoss;
    }

    public void setMaxElevationLoss(Float maxElevationLoss) {
        this.maxElevationLoss = maxElevationLoss;
    }

    public Integer getCadence() {
        return this.cadence;
    }

    public void setCadence(Integer cadence) {
        this.cadence = cadence;
    }

    public Integer getAvgCadence() {
        return this.avgCadence;
    }

    public void setAvgCadence(Integer avgCadence) {
        this.avgCadence = avgCadence;
    }

    public Integer getMaxCadence() {
        return this.maxCadence;
    }

    public void setMaxCadence(Integer maxCadence) {
        this.maxCadence = maxCadence;
    }

    public Integer getHeartrate() {
        return this.heartrate;
    }

    public void setHeartrate(Integer heartrate) {
        this.heartrate = heartrate;
    }

    public Integer getAvgHeartrate() {
        return this.avgHeartrate;
    }

    public void setAvgHeartrate(Integer avgHeartrate) {
        this.avgHeartrate = avgHeartrate;
    }

    public Integer getMaxHeartrate() {
        return this.maxHeartrate;
    }

    public void setMaxHeartrate(Integer maxHeartrate) {
        this.maxHeartrate = maxHeartrate;
    }

    public Float getMaxHeartratePer() {
        return this.maxHeartratePer;
    }

    public void setMaxHeartratePer(Float maxHeartratePer) {
        this.maxHeartratePer = maxHeartratePer;
    }

    public Float getHeartrateLTHT() {
        return this.heartrateLTHT;
    }

    public void setHeartrateLTHT(Float heartrateLTHT) {
        this.heartrateLTHT = heartrateLTHT;
    }

    public Float getPower() {
        return this.power;
    }

    public void setPower(Float power) {
        this.power = power;
    }

    public Float getAvgPower() {
        return this.avgPower;
    }

    public void setAvgPower(Float avgPower) {
        this.avgPower = avgPower;
    }

    public Float getMaxPower() {
        return this.maxPower;
    }

    public void setMaxPower(Float maxPower) {
        this.maxPower = maxPower;
    }

    public Float getAvg3sPower() {
        return this.avg3sPower;
    }

    public void setAvg3sPower(Float avg3sPower) {
        this.avg3sPower = avg3sPower;
    }

    public Float getAvg10sPower() {
        return this.avg10sPower;
    }

    public void setAvg10sPower(Float avg10sPower) {
        this.avg10sPower = avg10sPower;
    }

    public Float getAvg30sPower() {
        return this.avg30sPower;
    }

    public void setAvg30sPower(Float avg30sPower) {
        this.avg30sPower = avg30sPower;
    }

    public Float getPowerFTPPer() {
        return this.powerFTPPer;
    }

    public void setPowerFTPPer(Float powerFTPPer) {
        this.powerFTPPer = powerFTPPer;
    }

    public Float getPowerNP() {
        return this.powerNP;
    }

    public void setPowerNP(Float powerNP) {
        this.powerNP = powerNP;
    }

    public Float getPowerTSS() {
        return this.powerTSS;
    }

    public void setPowerTSS(Float powerTSS) {
        this.powerTSS = powerTSS;
    }

    public Float getTemperature() {
        return this.temperature;
    }

    public void setTemperature(Float temperature) {
        this.temperature = temperature;
    }

    public Float getMaxTemperature() {
        return this.maxTemperature;
    }

    public void setMaxTemperature(Float maxTemperature) {
        this.maxTemperature = maxTemperature;
    }

    public Float getMinTemperature() {
        return this.minTemperature;
    }

    public void setMinTemperature(Float minTemperature) {
        this.minTemperature = minTemperature;
    }

    public Integer getCalorie() {
        return this.calorie;
    }

    public void setCalorie(Integer calorie) {
        this.calorie = calorie;
    }


    public Integer getSteps() {
        return this.steps;
    }

    public void setSteps(Integer steps) {
        this.steps = steps;
    }

    public Float getDirection() {
        return this.direction;
    }

    public void setDirection(Float direction) {
        this.direction = direction;
    }

    public Integer getAzimuth() {
        //Log.d(TAG, "getAzimuth is " +String.valueOf(this.azimuth));
        return this.azimuth;

    }

    public void setAzimuth(Integer azimuth) {
        //Log.d(TAG,"setAzimuth is "+String.valueOf(azimuth));
        this.azimuth = azimuth;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this.workoutId);
        dest.writeFloat(this.accuracy);
        dest.writeFloat(this.pressure);
        dest.writeInt(this.sportState);
        dest.writeInt(this.sportType);
        dest.writeParcelable(this.location, flags);
        dest.writeValue(this.distance);
        dest.writeValue(this.speed);
        dest.writeValue(this.avgSpeed);
        dest.writeValue(this.maxSpeed);
        dest.writeValue(this.totalAvgSpeed);
        dest.writeValue(this.duration);
        dest.writeValue(this.totalDuration);
        dest.writeValue(this.pauseDuration);
        dest.writeValue(this.altitude);
        dest.writeValue(this.maxAltitude);
        dest.writeValue(this.minAltitude);
        dest.writeValue(this.grade);
        dest.writeValue(this.elevationGain);
        dest.writeValue(this.elevationLoss);
        dest.writeValue(this.avgElevationGain);
        dest.writeValue(this.avgElevationLoss);
        dest.writeValue(this.maxElevationGain);
        dest.writeValue(this.maxElevationLoss);
        dest.writeValue(this.cadence);
        dest.writeValue(this.avgCadence);
        dest.writeValue(this.maxCadence);
        dest.writeValue(this.heartrate);
        dest.writeValue(this.avgHeartrate);
        dest.writeValue(this.maxHeartrate);
        dest.writeValue(this.maxHeartratePer);
        dest.writeValue(this.heartrateLTHT);
        dest.writeValue(this.power);
        dest.writeValue(this.avgPower);
        dest.writeValue(this.maxPower);
        dest.writeValue(this.avg3sPower);
        dest.writeValue(this.avg10sPower);
        dest.writeValue(this.avg30sPower);
        dest.writeValue(this.powerFTPPer);
        dest.writeValue(this.powerNP);
        dest.writeValue(this.powerTSS);
        dest.writeValue(this.temperature);
        dest.writeValue(this.maxTemperature);
        dest.writeValue(this.minTemperature);
        dest.writeValue(this.calorie);
        dest.writeValue(this.steps);
        dest.writeValue(this.direction);
        dest.writeValue(this.azimuth);
    }

    protected DisplayPoint(Parcel in2) {
        this.workoutId = in2.readLong();
        this.accuracy = in2.readFloat();
        this.pressure = in2.readFloat();
        this.sportState = in2.readInt();
        this.sportType = in2.readInt();
        this.location = (Location) in2.readParcelable(Location.class.getClassLoader());
        this.distance = (Double) in2.readValue(Double.class.getClassLoader());
        this.speed = (Double) in2.readValue(Double.class.getClassLoader());
        this.avgSpeed = (Double) in2.readValue(Double.class.getClassLoader());
        this.maxSpeed = (Double) in2.readValue(Double.class.getClassLoader());
        this.totalAvgSpeed = (Double) in2.readValue(Double.class.getClassLoader());
        this.duration = (Long) in2.readValue(Long.class.getClassLoader());
        this.totalDuration = (Long) in2.readValue(Long.class.getClassLoader());
        this.pauseDuration = (Long) in2.readValue(Long.class.getClassLoader());
        this.altitude = (Double) in2.readValue(Double.class.getClassLoader());
        this.maxAltitude = (Double) in2.readValue(Double.class.getClassLoader());
        this.minAltitude = (Double) in2.readValue(Double.class.getClassLoader());
        this.grade = (Float) in2.readValue(Float.class.getClassLoader());
        this.elevationGain = (Float) in2.readValue(Float.class.getClassLoader());
        this.elevationLoss = (Float) in2.readValue(Float.class.getClassLoader());
        this.avgElevationGain = (Float) in2.readValue(Float.class.getClassLoader());
        this.avgElevationLoss = (Float) in2.readValue(Float.class.getClassLoader());
        this.maxElevationGain = (Float) in2.readValue(Float.class.getClassLoader());
        this.maxElevationLoss = (Float) in2.readValue(Float.class.getClassLoader());
        this.cadence = (Integer) in2.readValue(Integer.class.getClassLoader());
        this.avgCadence = (Integer) in2.readValue(Integer.class.getClassLoader());
        this.maxCadence = (Integer) in2.readValue(Integer.class.getClassLoader());
        this.heartrate = (Integer) in2.readValue(Integer.class.getClassLoader());
        this.avgHeartrate = (Integer) in2.readValue(Integer.class.getClassLoader());
        this.maxHeartrate = (Integer) in2.readValue(Integer.class.getClassLoader());
        this.maxHeartratePer = (Float) in2.readValue(Float.class.getClassLoader());
        this.heartrateLTHT = (Float) in2.readValue(Float.class.getClassLoader());
        this.power = (Float) in2.readValue(Float.class.getClassLoader());
        this.avgPower = (Float) in2.readValue(Float.class.getClassLoader());
        this.maxPower = (Float) in2.readValue(Float.class.getClassLoader());
        this.avg3sPower = (Float) in2.readValue(Float.class.getClassLoader());
        this.avg10sPower = (Float) in2.readValue(Float.class.getClassLoader());
        this.avg30sPower = (Float) in2.readValue(Float.class.getClassLoader());
        this.powerFTPPer = (Float) in2.readValue(Float.class.getClassLoader());
        this.powerNP = (Float) in2.readValue(Float.class.getClassLoader());
        this.powerTSS = (Float) in2.readValue(Float.class.getClassLoader());
        this.temperature = (Float) in2.readValue(Float.class.getClassLoader());
        this.maxTemperature = (Float) in2.readValue(Float.class.getClassLoader());
        this.minTemperature = (Float) in2.readValue(Float.class.getClassLoader());
        this.calorie = (Integer) in2.readValue(Integer.class.getClassLoader());
        this.steps = (Integer) in2.readValue(Integer.class.getClassLoader());
        this.direction = (Float) in2.readValue(Float.class.getClassLoader());
        this.azimuth = (Integer) in2.readValue(Integer.class.getClassLoader());
    }
}
